home *** CD-ROM | disk | FTP | other *** search
/ MacAddict 114 / macaddict114.cdr / Software / Utilities / macam.0.8.4.dmg / macam sources / driver_core / MyCameraInfo.m < prev    next >
Encoding:
Text File  |  2005-08-15  |  2.6 KB  |  135 lines

  1. /*
  2.  macam - webcam app and QuickTime driver component
  3.  Copyright (C) 2002 Matthias Krauss (macam@matthias-krauss.de)
  4.  
  5.  This program is free software; you can redistribute it and/or modify
  6.  it under the terms of the GNU General Public License as published by
  7.  the Free Software Foundation; either version 2 of the License, or
  8.  (at your option) any later version.
  9.  
  10.  This program is distributed in the hope that it will be useful,
  11.  but WITHOUT ANY WARRANTY; without even the implied warranty of
  12.  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  13.  GNU General Public License for more details.
  14.  
  15.  You should have received a copy of the GNU General Public License
  16.  along with this program; if not, write to the Free Software
  17.  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  18.  $Id: MyCameraInfo.m,v 1.4 2005/08/15 05:29:30 hxr Exp $
  19.  */
  20.  
  21. #import "MyCameraInfo.h"
  22.  
  23. static unsigned long cidCount=1;
  24.  
  25. @implementation MyCameraInfo
  26.  
  27. - (id) init {
  28.     self=[super init];
  29.     if (self==NULL) return NULL;
  30.     notification=IO_OBJECT_NULL;
  31.     driver=NULL;
  32.     driverClass=NULL;
  33.     cid=cidCount++;
  34.     central=NULL;
  35.     name=NULL;
  36.     pid=0;
  37.     vid=0;
  38.     lid=0;
  39.     return self;
  40. }
  41.  
  42. - (id) copy {
  43.     MyCameraInfo* c=[[MyCameraInfo alloc] init];
  44.     if (c==NULL) return NULL;
  45.     [c setNotification:[self notification]];
  46.     [c setDriver:[self driver]];
  47.     [c setDriverClass:[self driverClass]];
  48.     [c setCentral:[self central]];
  49.     [c setCameraName:[self cameraName]];
  50.     [c setProductID:[self productID]];
  51.     [c setVendorID:[self vendorID]];
  52.     [c setLocationID:[self locationID]];
  53.     return c;
  54. }
  55.  
  56. - (void) dealloc 
  57. {
  58.     if (name) 
  59.         [name release];
  60.     name = NULL;
  61.     
  62.     [super dealloc];
  63. }
  64.  
  65. - (io_object_t) notification {
  66.     return notification;
  67. }
  68.  
  69. - (void) setNotification:(io_object_t)n {
  70.     notification=n;
  71. }
  72.  
  73. - (Class) driverClass {
  74.     return driverClass;
  75. }
  76.  
  77. - (void) setDriverClass:(Class)c {
  78.     driverClass=c;
  79. }
  80.  
  81. - (id) driver {
  82.     return driver;
  83. }
  84.  
  85. - (void) setDriver:(id)d {
  86.     driver=d;
  87. }
  88. - (id) central {
  89.     return central;
  90. }
  91.  
  92. - (void) setCentral:(id)c {
  93.     central=c;
  94. }
  95.  
  96. - (unsigned long) cid {
  97.     return cid;
  98. }
  99.  
  100.  
  101. - (NSString*) cameraName {
  102.     return name;
  103. }
  104.  
  105. - (void) setCameraName:(NSString*)camName {
  106.     if (name) [name release]; name=NULL;
  107.     if (camName!=NULL) name=[camName copy];
  108. }
  109.  
  110. - (long) productID {
  111.     return pid;
  112. }
  113.  
  114. - (void) setProductID:(long)prodID {
  115.     pid=prodID;
  116. }
  117.  
  118. - (long) vendorID {
  119.     return vid;
  120. }
  121.  
  122. - (void) setVendorID:(long)vendID {
  123.     vid=vendID;
  124. }
  125.  
  126. - (UInt32) locationID {
  127.     return lid;
  128. }
  129.  
  130. - (void) setLocationID:(UInt32)locID {
  131.     lid=locID;
  132. }
  133.  
  134. @end
  135.